package com.chaos.eurekaproducer.controller;

import com.chaos.eurekaproducer.annotation.ExceptionFlag;
import com.chaos.eurekaproducer.domain.User;
import com.chaos.eurekaproducer.rabbitmq.RabbitMqProductor;
import com.chaos.eurekaproducer.service.IUserService;
import com.chaos.eurekaproducer.test.MyCondition;
import com.fasterxml.jackson.databind.JsonNode;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;
import java.util.List;

/**
 * @author liaopeng
 * @title: MqController
 * @projectName eureka-producer
 * @description:
 * @date 2021/7/14上午10:15
 */
@RestController
@RequestMapping("/rabbitMq")
public class MqController {

    @Autowired
    private IUserService userService;

    @RequestMapping("/send")
    @ExceptionFlag
    public void  send(@RequestBody String strJson){
        System.out.println("当前线程："+Thread.currentThread().getName());
        User user = new User();
        user.setId(1L);
        user.setName("chaos3583");
        userService.update(user);
    }
}
